Repository navigation
Conversation
bjornmp
force-pushed
the
fix/wayland-nested-modifier-forwarding
branch
3 times, most recently
from
July 21, 2026 00:41
8f9e787 to
8d7e59d
Compare
Open
4 of 6 tasks
When running nested on a Wayland compositor, gamescope received wl_keyboard.modifiers from the host but only stored them locally. Key events were injected through a virtual keyboard with no modifier state, so Xwayland clients saw key presses with state 0x0. Forward modifier updates to the keyboard group and inject keys through that keyboard so the seat reports correct Shift/Ctrl/Alt state. Fixes ValveSoftware#1740 Fixes ValveSoftware#2032 Co-authored-by: Cursor <cursoragent@cursor.com>
bjornmp
force-pushed
the
fix/wayland-nested-modifier-forwarding
branch
from
September 16, 2026 23:39
8d7e59d to
405816d
Compare
Author
|
Rebased this onto the latest master to resolve the conflicts. I also rebuilt and tested it locally, and modifier forwarding is still working as expected. |
Collaborator
|
sorry, there are quite a few issues with this approach. forward modifiers get wiped on any focus change inside of gamescope, modifiers are never cleared when focus leaves, and the null guard is wrong. I'm working on a branch that'll include forwarding modifiers in a way I'm more comfortable with merging. I'll give you a suggested-by and cc you on it when it's up |
Author
|
That's fine. This probably needs to be part of a larger wayland input refactor anyway. This was mostly a quick fix I've been using for my immediate need as there was no forwarding at all up to this point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When gamescope runs nested on a Wayland compositor, it receives
wl_keyboard.modifiersfrom the host compositor but previously only stored them locally. Key events were injected via a stub virtual keyboard with no modifier state, so clients (especially Xwayland apps) received key presses with modifier state0x0.This change forwards modifier events to the wlroots
keyboard_groupand injects keys through that keyboard, so the seat reports correct Shift/Ctrl/Alt state.Fixes #1740
Fixes #2032
Root cause
Discussed in #1740: older Xwayland versions ran their own XKB state machine and masked this bug. Xwayland 24.1.5+ correctly expects the compositor to forward modifier state (xserver MR 1758), which exposed the issue in gamescope.
Test plan
gamescope -- konsole— Shift+letters produce capitalsEnvironment
976f7fc) with this patchMade with Cursor